---
description:
  GraphQL Yoga provides you a cross-platform GraphQL Server. So you can easily integrate it into any
  platform besides Node.js.
---

# Integration with Deno

GraphQL Yoga provides you a cross-platform GraphQL Server. So you can easily integrate it into any
platform besides Node.js.
[Deno is a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust](https://deno.com/).
We will use `graphql-yoga` which has an agnostic HTTP handler using
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch)'s
[`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) and
[`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) objects.

## Example

Create a `deno.json` file.
[Learn more about import maps](https://docs.deno.com/runtime/fundamentals/modules/#managing-third-party-modules-and-libraries)

Create a `deno-yoga.ts` file:

```json filename="deno.json" {3}
{
  "imports": {
    "graphql-yoga": "npm:graphql-yoga@^3.7.3"
  }
}
```

```ts filename="deno-yoga.ts"
import { createSchema, createYoga } from 'graphql-yoga'

const yoga = createYoga({
  schema: createSchema({
    typeDefs: /* GraphQL */ `
      type Query {
        hello: String!
      }
    `,
    resolvers: {
      Query: {
        hello: () => 'Hello Deno!'
      }
    }
  })
})

Deno.serve(yoga, {
  onListen({ hostname, port }) {
    console.log(`Listening on http://${hostname}:${port}/${yoga.graphqlEndpoint}`)
  }
})
```

And run it:

```bash
deno run --allow-net deno-yoga.ts
```

> You can also check a full example on our GitHub repository
> [here](https://github.com/graphql-hive/graphql-yoga/tree/main/examples/deno)
